package com.yanmaohu.yulia.bean;

import java.util.List;

/**
 * @author Bright Lee
 */
public final class BooleanValueExpression implements
        ContextuallyTypedRowValueConstructor,
        RowValueConstructor,
        ValueExpression {

    private int beginIndex;
    private int endIndex;
    private List<BooleanTerm> booleanTermList;

    public BooleanValueExpression(List<BooleanTerm> booleanTermList) {
        this.beginIndex = booleanTermList.get(0).getBeginIndex();
        this.endIndex = booleanTermList.get(booleanTermList.size() - 1).getEndIndex();
        this.booleanTermList = booleanTermList;
    }

    @Override
    public int getBeginIndex() {
        return beginIndex;
    }

    @Override
    public int getEndIndex() {
        return endIndex;
    }

    public int size() {
        return booleanTermList.size();
    }

    public BooleanTerm get(int index) {
        return booleanTermList.get(index);
    }

}
